package d0326;

//import d0324.StudentAgeComparator;




import java.util.Collection;
import java.util.Set;
import java.util.TreeSet;

public class TestTreeSet {
    public static void main(String[] args) {
        Set<Student> treeSet = new TreeSet();
        //  treeSet.add(45);
        //  treeSet.add(5);
        // treeSet.add(69);
        //   treeSet.add(9);
        //   treeSet.add(9);
        Student stu1 = new Student("jack", 21, 98);
        Student stu2 = new Student("weak", 15, 56);
        Student stu3 = new Student("jack", 2, 98);
        treeSet.add(stu1);
        treeSet.add(stu2);
        treeSet.add(stu3);
        System.out.println("个数是:" + treeSet.size());
   /*     for (Integer i:
        treeSet){
            System.out.println(i);
        }*/
        for (Student stu :
                treeSet) {
            System.out.println(stu);
        }

    }
}